<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1,shrink-to-fit=no"
    />
    <title>Camera when CSS parsing disabled</title>
    <style>
      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      html,
      body {
        height: 100%;
      }

      #container {
        width: 100%;
        height: 100%;
      }
    </style>
  </head>

  <body>
    <div id="container"></div>
    <script
      src="../packages/g/dist/index.umd.min.js"
      type="application/javascript"
    ></script>
    <script
      src="../packages/g-canvas/dist/index.umd.min.js"
      type="application/javascript"
    ></script>
    <script>
      const { Circle, Canvas, runtime } = window.G;

      // create a renderer
      const canvasRenderer = new window.G.Canvas2D.Renderer();

      // create a canvas
      const canvas = new Canvas({
        container: 'container',
        width: 600,
        height: 500,
        renderer: canvasRenderer,
      });

      canvas.addEventListener('ready', () => {
        const circle = new Circle({
          style: {
            cx: 0,
            cy: 0,
            r: 100,
            fill: 'red',
          },
        });
        canvas.appendChild(circle);

        const camera = canvas.getCamera();

        camera.createLandmark('reset', {
          position: [0, 0],
          focalPoint: [0, 0],
          zoom: 1,
        });

        camera.gotoLandmark('reset', {
          duration: 2000,
          easing: 'ease-in',
          onfinish: () => {},
        });
      });
    </script>
  </body>
</html>
